//
//  TTRequestModel.swift
//  TianTianBiTing
//
//  Created by Gox mac 2 on 2018/12/28.
//  Copyright © 2018 Gox_WallyDiao. All rights reserved.
//

import Foundation
import SwiftyJSON
import Alamofire

class TTRequestModel {
    private var url:String = ""
    private var method:Alamofire.HTTPMethod = .post
    private var parameters: Parameters?
    private var headers: HTTPHeaders?
    var resultsBlock:((JSON) -> Void)?
    var dataResponseBlock:((Alamofire.DataResponse<Any>?) -> Void)?
    
    init(url:String,method:Alamofire.HTTPMethod,parameters: Parameters?,headers: HTTPHeaders?,resultsBlock:((JSON) -> Void)?) {
        self.url = url
        self.method = method
        self.parameters = parameters
        self.headers = headers
        self.resultsBlock = resultsBlock
    }
    init(url:String,method:Alamofire.HTTPMethod,parameters: Parameters?,headers: HTTPHeaders?,dataResponseBlock:@escaping ((Alamofire.DataResponse<Any>?) -> Void)) {
        self.url = url
        self.method = method
        self.parameters = parameters
        self.headers = headers
        self.dataResponseBlock = dataResponseBlock
    }
    
    func getUrl() -> String {
        return self.url
    }
    
    func getMethod() -> Alamofire.HTTPMethod {
        return self.method
    }
    func getparameters() -> Parameters? {
        return self.parameters
    }
    func getHeaders() -> HTTPHeaders? {
        return self.headers
    }
}
